import { getBanner } from '@/service/banner';
export default {
  state: {
    banner_list: [],
  },
  effects: {
    *getBannerList({ payload }: any, { put, call }: any) {
      const ret = yield call(getBanner);
      if (ret.code === 0) {
        yield put({
          type: 'setBanner_list',
          payload: ret.data,
        });
      }
    },
  },
  reducers: {
    setBanner_list(state, action) {
      return {
        ...state,
        banner_list: action.payload,
      };
    },
  },
};
